﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace UserControlLibrary
{
    public partial class SwapTextButton : System.Windows.Forms.Button
    {
        private string _text1;
        public string Text1 
        {
            get { return _text1; }
            set { _text1 = value;  this.Text = Text1; } 
        }
        public string Text2 { get; set; }
        private static int count = 0;

        public SwapTextButton()
        {
            InitializeComponent();
        }

        public SwapTextButton(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }

        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);
            count++;
            if (Text == Text1)
                Text = Text2;
            else
                Text = Text1;
        }
    }
}
